package redis_key

import "fmt"

type RedisKey string

func (k RedisKey) ToString(args ...any) string {
	if len(args) == 0 {
		return string(k)
	}
	return fmt.Sprintf(string(k), args...)
}

const (

	// 用户身份缓存
	UserInfo RedisKey = "user:info:%d" // %d = uid

	UserToken RedisKey = "user:token:%d" //用户token %d = uid, 旧的，还想还存了用户信息

	UserAccessToken RedisKey = "accessToken" //用户token, hash表 fields = uid

	UserGuildInfo RedisKey = "user:guild:%d" //用户公会信息

	LangKey       RedisKey = "lang:%s"            //多语言缓存键,kv结构 key: lang:group.key, value: map[lang]string
	Banner        RedisKey = "banner:%s:%d"       //banner数据缓存，kv结构 key: banner:region:typ, value:[]*BannerModel
	GuildInfo     RedisKey = "guild:%d"           //banner数据缓存，kv结构 key: banner:region:typ, value:[]*BannerModel
	OrderAuthLock RedisKey = "order:auth_lock:%d" //order下发金币时加锁处理，不然会客户端并发上报时会重复下发
	OrderAuth     RedisKey = "order:auth:%d"      //order下发金币时加锁处理，不然会客户端并发上报时会重复下发

	GroupBoxCurr RedisKey = "groupBoxCurr:%d:%s"
)
